//
//  QP_HUD.m
//  A_project2.0
//
//  Created by Tiny on 16/3/16.
//  Copyright © 2016年 七平. All rights reserved.
//

#import "QP_HUD.h"

@implementation QP_HUD
{
    //HUD（Head-Up Display，意思是抬头显示的意思）
    MBProgressHUD *HUD;
}
-(id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self showProgressDialog];
    }
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)showProgressDialog
{
    HUD = [[MBProgressHUD alloc] initWithView:self];
    // 2. 添加到当前视图中
    [self addSubview:HUD];
    // 如果设置此属性, 则置后当前的View
    HUD.dimBackground = YES;
    HUD.labelText = @"请稍等";
    // 设置模式
    HUD.mode = MBProgressHUDModeIndeterminate;
    //    HUD.color = [UIColor colorWithWhite:0.800 alpha:1.000];
    [HUD show:YES];
    
}

@end
